

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>RBD 重放 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="Ceph 块设备与第三方对接" href="../rbd-integrations/" />
    <link rel="prev" title="配置选项" href="../rbd-config-ref/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../">Ceph 块设备</a> &raquo;</li>
        
          <li><a href="../rbd-operations/">Ceph 块设备运维</a> &raquo;</li>
        
      <li>RBD 重放</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/rbd/rbd-replay.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../">
          

          
            
            <img src="../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 块设备</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../rados-rbd-cmds/">基本命令</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../rbd-operations/">运维</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../rbd-snapshot/">快照</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-exclusive-locks/">互斥锁、独占锁</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-mirroring/">镜像</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-live-migration/">实时迁移</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-persistent-read-only-cache/">永久只读缓存</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-persistent-write-log-cache/">永久写日志缓存</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-encryption/">加密</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-config-ref/">配置选项 (librbd)</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">RBD 重放</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../rbd-integrations/">对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../man/">手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="rbd">
<h1>RBD 重放<a class="headerlink" href="#rbd" title="Permalink to this headline">¶</a></h1>
<p id="index-0">RBD 重放是个用于捕捉和重放 Rados 块设备（ RBD ）载荷的工具集。
要捕捉 RBD 载荷，必须在客户端安装 <code class="docutils literal notranslate"><span class="pre">lttng-tools</span></code> ，
且客户端上的 <code class="docutils literal notranslate"><span class="pre">librbd</span></code> 必须在 Giant 版以上。
要重放 RBD 载荷，客户端上的 <code class="docutils literal notranslate"><span class="pre">librbd</span></code> 必须在 Giant 版以上。</p>
<p>捕捉、重放需三步：</p>
<ol class="arabic">
<li><p>捕捉一个追踪过程，确保捕捉的是 <code class="docutils literal notranslate"><span class="pre">pthread_id</span></code> 上下文：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mkdir</span> <span class="o">-</span><span class="n">p</span> <span class="n">traces</span>
<span class="n">lttng</span> <span class="n">create</span> <span class="o">-</span><span class="n">o</span> <span class="n">traces</span> <span class="n">librbd</span>
<span class="n">lttng</span> <span class="n">enable</span><span class="o">-</span><span class="n">event</span> <span class="o">-</span><span class="n">u</span> <span class="s1">&#39;librbd:*&#39;</span>
<span class="n">lttng</span> <span class="n">add</span><span class="o">-</span><span class="n">context</span> <span class="o">-</span><span class="n">u</span> <span class="o">-</span><span class="n">t</span> <span class="n">pthread_id</span>
<span class="n">lttng</span> <span class="n">start</span>
<span class="c1"># run RBD workload here</span>
<span class="n">lttng</span> <span class="n">stop</span>
</pre></div>
</div>
</li>
<li><p>用 <a class="reference external" href="../../man/8/rbd-replay-prep">rbd-replay-prep</a> 处理捕捉到的追踪结果：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rbd</span><span class="o">-</span><span class="n">replay</span><span class="o">-</span><span class="n">prep</span> <span class="n">traces</span><span class="o">/</span><span class="n">ust</span><span class="o">/</span><span class="n">uid</span><span class="o">/*/*</span> <span class="n">replay</span><span class="o">.</span><span class="n">bin</span>
</pre></div>
</div>
</li>
<li><p>用 <a class="reference external" href="../../man/8/rbd-replay">rbd-replay</a> 重放此追踪过程。
熟知它的行为前请用只读模式：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rbd</span><span class="o">-</span><span class="n">replay</span> <span class="o">--</span><span class="n">read</span><span class="o">-</span><span class="n">only</span> <span class="n">replay</span><span class="o">.</span><span class="n">bin</span>
</pre></div>
</div>
</li>
</ol>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p><code class="docutils literal notranslate"><span class="pre">rbd-replay</span></code> 默认会销毁数据。不要在想保留的映像上使用，
除非指定了 <code class="docutils literal notranslate"><span class="pre">--read-only</span></code> 选项。</p>
</div>
<p>重放载荷并非只能在与捕获时相同的 RBD 映像或相同的集群上进行。
为说明差异，你也许得在执行 <code class="docutils literal notranslate"><span class="pre">rbd-replay</span></code> 命令时指定 <code class="docutils literal notranslate"><span class="pre">--pool</span></code> 和 <code class="docutils literal notranslate"><span class="pre">--map-image</span></code> 选项。</p>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../rbd-integrations/" class="btn btn-neutral float-right" title="Ceph 块设备与第三方对接" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../rbd-config-ref/" class="btn btn-neutral float-left" title="配置选项" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>